#ifndef VOBJECT_H
#define VOBJECT_H

#include "vobjkind.h"

#define VIRTUAL_OBJECT	\
	void *cVTable;

typedef struct _CVObj
{
	VIRTUAL_OBJECT
} CVObj, *pCVObj;

#define VOBJ(This)		((pCVObj)This)
#define VTABLE(This)	(VOBJ(This)->cVTable)
#define PVOBJ			void *

#define VFUNC(This, VTableType, VFunc)	\
	(((VTableType)VTABLE(This))->VFunc)

PLIBEXP void	deleteVObj(PVOBJ);

// public
PLIBEXP uint8	VObjKind(PVOBJ);
PLIBEXP bool8	VObjIsA(PVOBJ, uint8);

// protected

// private

// virtual
void	VObjDestructV(pCVObj);
uint8	VObjKindV(pCVObj);
bool8	VObjIsAV(pCVObj, uint8);

#define VOBJVTABLE						\
	void  (*VObjDestruct)(pCVObj);		\
	uint8 (*VObjKind)(pCVObj);			\
	bool8 (*VObjIsA)(pCVObj, uint8);

#endif
